<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");

if ($_SESSION["permission"][$posScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}

echo headerPage("Cancel Bill");
?>
<SCRIPT src="js/jquery.numeric.js"></script>
<SCRIPT src="js/js_cancel.js"></SCRIPT> 
 <script>
$(function() {

	$( "#txtDateFrom" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-10:c+1',			
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
				
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		changeMonth: true,
		changeYear: true,
		yearRange:'c-10:c+1',					
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
<FORM name="Act" id="Act" action="cancel_detail.php" method="post"> 
<INPUT type=hidden value="" id="hBillNo" name="hBillNo"> 
<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
							<td><a href="javascript:void('0');" id="btnBack">
								<span class="icon_back"></span>Back
								</a>
							</td>
														 <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
						</tr>
                        </table>
                    </div>
                      <div class="header" style="background-image: url(images/script-delete.png);">
						Cancel Bill
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
				  <table width="100%" id='searchdata'>
					<?php   if ($_SESSION['branchtype'] =="3"){ ?>
						<tr>
							<td width="15%" class="fontSearch" style="padding-left:20">
								Branch Name : 
							</td>
							<td width="85%" align=left >
								<select id="cboBranch" style="width:15em;"></select>
							</td>
						</tr>
					<?php  }?>				  
						<tr>
							<td width="15%" class="fontSearch" style="padding-left:20">
								Bill No. : 
							</td>
							<td width="85%" align=left >
								<input id="txtBillNo"  title="Filter by bill no "  type="text" size=40 name="txtBillNo" class="boxItem" />
							</td>
						</tr>
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">
								Customer Name : 
                            </td>
							<td width="85%" align=left >
							<input id="txtCustName"  title="Filter by customer Name "  type="text"  	size=40 name="txtCustName" class="boxItem" />
							</td>
                         </tr>
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">
                            Sale Date : 
                            </td>
							<td width="85%" align=left >
								<input id="txtDateFrom"  title="Filter by Sale Date " type="text" size=10 name="txtDateFrom" class="boxItem" />
								&nbsp;- <input id="txtDateTo"  title="Filter by Sale Date " type="text" size=10 name="txtDateTo" class="boxItem" />
							 
							</td>
                        </tr>	
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20;padding-bottom:10px;">
								Type : 
                            </td>
							<td width="85%" align=left >
								<input type='radio' name='canceltype' id='type_1' value="0" checked />Normal
								<input type='radio' name='canceltype' id='type_2' value="1" />Cancel
							</td>
                         </tr>
						 <tr><td/><td>
						 <a href="javascript:void('0');" id="btnSearch"><img src="./images/btn-search.gif" border=0/></a> </td></tr>
						 <tr><td colspan="2"></tr>
                    </table>
                    <table cellspacing="1" id="resultData" class=list>
                    <thead>
                       <tr>
								<th width="7%" >Bill No.</th>
								<th style='display:none;'>id</th>
								<th class="title" width="16%" >Branch</th>
								<th class="title" width="20%" >Customer Name</th>
								<th  class="title" width="10%"  nowrap="nowrap">SaleDate</th>
								<th  class="title" width="8%"  nowrap="nowrap">Total Amt</th>
								<th  class="title" width="8%"  nowrap="nowrap">Discount</th>
								<th  class="title" width="8%"  nowrap="nowrap">Total Net</th>
								<th  class="title" width="8%"  nowrap="nowrap">Payment Amt</th>
								<th  class="title" width="5%"  nowrap="nowrap">Re-Print</th>
								<th  class="title" width="5%"  nowrap="nowrap">Detail</th>
								<th  class="title" width="5%"  nowrap="nowrap">Cancel</th>
                       </tr>
                    </thead>
                   <tbody>
                   </tbody>
                   <tfoot>
                         <tr>
							<td colspan="12">
									<div class="boxfooter">
									<div id="paging_btn">  </div> 
								 <div class="totalpage">Total : <span id="rowCount">0</span>&nbsp;&nbsp;rows</div>
								 </div>
							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10" id='rightboder' style="border-right:2px solid #facb0c;">&nbsp;</td>
   </tr>
</table>
 </FORM>

<div id="dialog-confirm" title="Confirm delete?" style="padding-top:20px;">
	<p style="font-size:13px"><span class="ui-icon ui-icon-alert" style="float:left; margin:0 10px 5px 10px;">
		</span>Are you sure to cancel this Bill?</p>
</div>
<?php 
echo footer();
?>